import numpy as np
import math
import operator
import itertools

sd=np.zeros(5)
mu=np.zeros(5)
prob=np.zeros(5)

x=[23,8,40,35,1]

y=[[4,6,7,43,1],
   [46,36,4,8,1],
   [77,55,66,65,1],
   [4,6,7,43,0],
   [77,55,66,65,0]]
a=np.array(y)

for rows,i in itertools.izip(a,range(len(a))):
#         print i
#         print a[:,(i):(i+1)]
        mu[i]=np.mean(a[:,(i):(i+1)])
        sd[i]=np.std(a[:,(i):(i+1)])
        prob[i]=np.exp(-np.square((x[i]-mu[i]))/(2*np.square(sd[i])))/np.sqrt(2*np.pi*np.square(sd[i]))  #probability for continuous function
print mu
print sd



print prob